# print("这是第一行")
# a=10
# # a=input("请输入数字")
# def even_number():
#     for i in range(0,20,2):
#         print(i)

# even_number()

# print("这是第二行")
# a=int(input("输入"))
# a=a+1
# def 七(a):
#     for i in range(1,7*a):
#         print(list(range(7,7*a,7)))
# 七(a)

# print("这是第三行")
# n =int(input("指数"))
# # print(range(1,n))
# def powers(n):
#     for i in range(1,n):
#         # print(list(range(1,n)))
#         range(2**i)
#         print(list(range(2**i)))
        
# powers(n)

print("这是第四行")  #ai写的
def generate_powers_of_two(n):
    """
    返回前 n 个 2 的幂，结果为列表。
    示例: generate_powers_of_two(5) -> [1, 2, 4, 8, 16]
    """
    if n < 0:
        raise ValueError("n 必须是非负整数")
    return [ 1 << i for i in range(n)]   # 1 << i 等价于 2**i

print(generate_powers_of_two(9))
